package org.grayrabbit.cloud.utils.logger;

import java.io.IOException;

import org.apache.log4j.Level;

public class LoggerOutput {
	
	private boolean pause = false;
	private int level = Level.ALL_INT;
	private String filter = "a";	//a:ALL(default)
	private Output out = null;		
	
	public LoggerOutput(Output out){		
		this.out = out;
	}
	
	public LoggerOutput(Output out,int level){		
		this.out = out;
		this.level = level;
	}
	
	public void writeln(String arg) throws IOException{
		out.writeln(arg);
	}
	
	public boolean isEnable(int level){
		return (level >= this.level) && (!pause);
	}
	
	public void setPause(boolean b){
		this.pause = b;
	}
		
	public void setLevel(int level){
		this.level = level;
	}
	
	public int getLevel(){
		return this.level;
	}
	
	public void setFilter(String filter){
		this.filter = filter;
	}
	
	public String getFilter(){
		return this.filter;
	}
	
}
